﻿using System;
using System.Web.UI;

namespace MyWeb.Controls
{
    public partial class admTop : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {  
            if (!IsPostBack){
                string strLanguage = "";
                string lang = Session["Lang"].ToString();
                string strLangName = Business.LanguageService.Language_GetById(lang)[0].Name;
                //List<Data.Language> list = Business.LanguageService.Language_GetByAll();
                //for (int i = 0; i < list.Count; i++)
                //{
                //    strLanguage += "";
                //}

                ltrLanguage.Text = string.Format("| &nbsp; Ngôn ngữ đang dùng: <b>{0}</b> &nbsp; {1}", strLangName, strLanguage);

                //| &nbsp; Ngôn ngữ đang dùng: <b>Tiếng Việt</b> &nbsp; <a href="/?page=change_lang&lang=en"><img alt="English" src="../App_Theme/admin/images/flag_en.gif" align="absmiddle" border="0" /></a> &nbsp;<a href="/?page=change_lang&lang=vi"><img alt="Vietnamese" src="../App_Theme/admin/images/flag_vi.gif" align="absmiddle" border="0" /></a>--%>
            }
        }


        protected void lbtDN_Click(object sender, EventArgs e)
        {

        }

        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
            Session["lang"] = "en";
               Session["LangAdm"] = "en";
               Response.Redirect(Request.Url.ToString());
        }

        protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
        {
            Session["lang"] = "vi";
               Session["LangAdm"] = "vi";
               Response.Redirect(Request.Url.ToString());
        }
    }
}